<?xml version="1.0" encoding="UTF-8" ?>
<!--
    Document   : cadastrarProduto
    Created on : 01 nov 2011, 11:17:59
    Author     : vinicius
-->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      >

    <ui:composition template="template.xhtml">
        <ui:define name="title">
            <h:outputText value="Cadastro de Novos usuários" />
        </ui:define>
        <ui:define name="body">


            <br></br><br></br><br></br><br></br><br></br>
            <h:panelGrid columns="3"  styleClass="tabelaRich500"
                         columnClasses="col30Right, alignCenter">
                <h:form>
                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['id.usuario']}: "  />
                        <h:inputText id="id" readonly="true" value="#{usuarioBusiness.ultId()}" />
                        <h:outputText value=" "  />
                    </h:panelGrid>

                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['nome.usuario']}: "  />
                        <h:inputText id="nome" value="#{usuarioBusiness.usuario.nome}"  required="true"
                                     validator="#{usuarioBusiness.validaNome}"
                                     requiredMessage="Informe o nome"/>
                        <h:message for="nome" styleClass="errorMessage"/>
                    </h:panelGrid>

                    

                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['telefone.usuario']}: "  />
                        <h:inputText id="telefone" value="#{usuarioBusiness.usuario.telefone}" required="true"
                                     validator="#{usuarioBusiness.validaTelefone}"
                                     requiredMessage="Informe o telefone"/>
                                    <h:message for="telefone" styleClass="errorMessage"/>
                                    
                    </h:panelGrid>

                    

                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['cpf.usuario']}: "  />
                        <h:inputText id="cpf" value="#{usuarioBusiness.usuario.cpf}" required="true"
                                     validator="#{usuarioBusiness.validaCpf}"
                                     requiredMessage="CPF Incorreto"/>
                        <h:message for="cpf" styleClass="errorMessage"/>
                    </h:panelGrid>

                    

                    <!--<h:panelGrid columns="2" styleClass="tabelaRich500" columnClasses="col166Right, col250Left">
                        <h:outputText value="#{msgs['data.usuario']}: "  />
                        <rich:calendar></rich:calendar>
                    </h:panelGrid>-->

                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['email.usuario']}: " />
                        <h:inputText id="email" value="#{usuarioBusiness.usuario.email}" required="true"
                                     validator="#{usuarioBusiness.validaEmail}"
                                     requiredMessage="Informe o email" />
                        <h:message for="email" styleClass="errorMessage"/>
                    </h:panelGrid>

                    


                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['login.usuario']}: " />
                        <h:inputText id="login" value="#{usuarioBusiness.usuario.login}"  required="true"
                                     validator="#{usuarioBusiness.validaLogin}"
                                     requiredMessage="Informe o login" />
                        <h:message for="login" styleClass="errorMessage"/>

                    </h:panelGrid>

                    

                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['senha.usuario']}: " />
                        <h:inputSecret id="senha" value="#{usuarioBusiness.usuario.senha}" />
                        <h:outputText value=" " />
                    </h:panelGrid>

                    <h:panelGrid columns="3" styleClass="tabelaRich500" columnClasses="col1,col2,col3">
                        <h:outputText value="#{msgs['senhanovamente.usuario']}: " />
                        <h:inputSecret id="confirmasenha"   value="#{usuarioBusiness.usuario.senha}" />
                        <h:outputText value=" " />
                    </h:panelGrid>


                    <h:panelGrid columns="2" styleClass="botoes">
                        <h:commandButton value="#{msgs['system.salvar']}" action="#{usuarioBusiness.salvarUsuario()}"  />
                        <h:commandButton value="#{msgs['system.cancelar']}"  />
                        
                    </h:panelGrid>

                </h:form>
            </h:panelGrid>

            <div id="logoadd">
                <h:graphicImage value="../imagens/add.png"/>
            </div>


        </ui:define>
    </ui:composition>
</html>
